<?php

require_once './application/core/CoreBase.php';
require_once './application/core/Client/clientSoap.php';

class visualisationSoap extends clientSoap
{

    private $_node;
    private $_groupe;
    private $_location;
    private $_service;
    private $_uri;
    private $_configPath;
    private $_cache;

    public function __construct(&$controller)
    {
        parent::__construct($controller);
        $this->_node = "Ip";
        $this->_groupe = "IRechercheSonde";
        $this->_configPath = './application/configuration/config.ini';
        $config = new Zend_Config_Ini($this->_configPath, 'sonde');
        $this->_location = $config->sonde->location;
        $this->_cache = new cache();
    }

    public function valideIp($params, $serviceResp)
    {
        $this->_service = "ValideIp";
        $this->_cache->deleteAllInfoSessionService($this->_controller->_idClient, 'valideIpResult');
        $this->_uri = $this->uriSoap($this->_groupe, $this->_service);
        $xml = $this->xmlSoap($this->_uri, $serviceResp, $this->_node, $params);
        $this->client($this->_uri, $this->_location, $xml);
    }

    public function lanceRecherche($params, $serviceResp)
    {
        $this->_service = "LanceRecherche";
        $this->_cache->deleteAllInfoSessionService($this->_controller->_idClient, 'lanceRechercheRecolteResult');
        $this->_uri = $this->uriSoap($this->_groupe, $this->_service);
        $xml = $this->xmlSoap($this->_uri, $serviceResp, $this->_node, $params);
        $this->client($this->_uri, $this->_location, $xml);
    }

    public function stopRecherche($params, $serviceResp)
    {
        $this->_service = "LanceRecherche";
        $this->_uri = $this->uriSoap($this->_groupe, $this->_service);
        $xml = $this->xmlSoap($this->_uri, $serviceResp, $this->_node, $params);
        $this->client($this->_uri, $this->_location, $xml);
    }

}
?>